import request from "@/utils/request";

// 客户档案-所有客户  原接口 /customer/member/page
export function getClientList(query) {
  return request({
    url: "/customer/member/page/all",
    method: "get",
    params: query,
  });
}

// 后台会员卡转账记录
export function getTransferPage(data) {
  return request({
    url: "/customer/card-transfer/page/admin",
    method: "post",
    data: data,
  });
}

// 客户档案-门店客户(本门店)
export function getStoreClientList(query) {
  return request({
    url: "/customer/member/page/store",
    method: "get",
    params: query,
  });
}

// 客户档案-门店可用客户
export function getAvailableClientList(query) {
  return request({
    url: "/customer/member/page/store/available",
    method: "get",
    params: query,
  });
}

// 客户档案-客户列表不分页
export function getClient(query) {
  return request({
    url: "/customer/member/page/all",
    method: "get",
    params: query,
  });
}

// 客户档案-新增客户
export function CreateClient(data) {
  return request({
    url: "/customer/member/create",
    method: "post",
    data: data,
  });
}

// 客户档案-客户详情基础信息
export function getClientInfo(query) {
  return request({
    url: "/customer/member/get",
    method: "get",
    params: query,
  });
}

// 客户档案详情-获取客户资金总额信息
export function getClientfundInfo(query) {
  return request({
    url: "/customer/card/getCardsMoney",
    method: "get",
    params: query,
  });
}

// 获得客户来源分页
export function getClientSource(query) {
  return request({
    url: "/customer/source/page",
    method: "get",
    params: query,
  });
}

// 创建客户来源
export function CreateClientSource(data) {
  return request({
    url: "/customer/source/create",
    method: "post",
    data: data,
  });
}

// 更新客户来源
export function UpdateClientSource(data) {
  return request({
    url: "/customer/source/update",
    method: "PUT",
    data: data,
  });
}

// 删除客户来源
export function DeleteClientSource(data) {
  return request({
    url: "/customer/source/delete",
    method: "DELETE",
    params: data,
  });
}

// 获得客户来源列表
export function getClientSourceList(query) {
  return request({
    url: "/customer/source/list",
    method: "get",
    params: query,
  });
}

// 办卡充值
export function CreateCard(data) {
  return request({
    url: "/customer/card/create",
    method: "post",
    data: data,
  });
}

// 赠送金金额
// export function getGiveMoney(query) {
//   return request({
//     url: "/customer/card/getGiveMoney",
//     method: "get",
//     params: query,
//   });
// }

// 获得门店员工
export function getStoreUser(query) {
  return request({
    url: "/order/store/user",
    method: "POST",
    data: query,
  });
}

// 获得会员账户流水分页
export function getMemberAccountPage(query) {
  return request({
    url: "/customer/account-statement/page",
    method: "get",
    params: query,
  });
}

// 冻结
export function FreezeCard(data) {
  return request({
    url: "/customer/card/freeze",
    method: "post",
    params: data,
  });
}

// 获得会员卡列表
export function getMemberCard(query) {
  return request({
    url: "/customer/card/list",
    method: "get",
    params: query,
  });
}

// 修改有效期
export function updateInDate(query) {
  return request({
    url: "/customer/card/updateInDate",
    method: "get",
    params: query,
  });
}

// 查询用户列表
export function listUser(query) {
  return request({
    url: "/system/user/page",
    method: "get",
    params: query,
  });
}

// 创建会员账户流水
export function CreateAccount(data) {
  return request({
    url: "/customer/account-statement/create",
    method: "post",
    data: data,
  });
}

// 修改密码
export function updatePassword(data) {
  return request({
    url: "/customer/card/updatePassword",
    method: "post",
    data: data,
  });
}

// 重置密码
export function resetPassword(data) {
  return request({
    url: "/customer/card/resetPassword",
    method: "post",
    params: data,
  });
}

// 调整
export function adjustment(data) {
  return request({
    url: "/customer/card/adjustment",
    method: "post",
    data: data,
  });
}

// 客户消费记录
export function ConsumptionRecords(data) {
  return request({
    url: "/order/page/customer",
    method: "post",
    data: data,
  });
}

// 解冻
export function updateThaw(data) {
  return request({
    url: "/customer/card/updateThaw",
    method: "post",
    params: data,
  });
}

// 根据客户标识查询本门店会员卡号
export function getMemberCards(query) {
  return request({
    url: "/customer/card/cust/cardNo",
    method: "get",
    params: query,
  });
}

// 搜索客户
export function storeAvailable(query) {
  return request({
    url: "/customer/member/store/available",
    method: "get",
    params: query,
  });
}

// 增加项目次卡
export function CreateProjectCard(data) {
  return request({
    url: "/customer/card/create/item",
    method: "post",
    data: data,
  });
}

// 会员卡转账
export function transferCard(data) {
  return request({
    url: "/customer/card/transfer",
    method: "post",
    data: data,
  });
}

// 获得会员卡转账记录分页
export function TransferPage(query) {
  return request({
    url: "/customer/card-transfer/page",
    method: "get",
    params: query,
  });
}

// 退卡
export function BackCard(data) {
  return request({
    url: "/customer/card/back",
    method: "post",
    data: data,
  });
}

// 解冻余额
export function updateThawMoney(query) {
  return request({
    url: "/customer/card/updateThaw/money",
    method: "get",
    params: query,
  });
}

// 修改卡号
export function cardNumbers(data) {
  return request({
    url: "/customer/card/edit/cardNumber",
    method: "post",
    data: data,
  });
}

// 会员卡调整
export function adjustMemberCard(data) {
  return request({
    url: "/customer/card/adjustment",
    method: "post",
    data: data,
  });
}

// 冲减
export function CardoffsettingApi(data) {
  return request({
    url: "/customer/card/offsetting",
    method: "post",
    data: data,
  });
}

// 修改客户信息
export function updateMemberUser(data) {
  return request({
    url: "/customer/member/edit",
    method: "post",
    data: data,
  });
}

// 客户档案-临时添加会员
export function addMemberUsertemp(data) {
  return request({
    url: "/customer/member/add/temp",
    method: "post",
    data: data,
  });
}

// 会员卡列表
export function MemberCardList(data) {
  return request({
    url: "/customer/card/page",
    method: "post",
    data: data,
  });
}

// 计算/不计算跨店消费
export function customerCardCross(query) {
  return request({
    url: "/customer/card/cross",
    method: "get",
    params: query,
  });
}

// 客户档案-隐藏显示客户
export function HideCustomer(query) {
  return request({
    url: "/customer/member/hide",
    method: "get",
    params: query,
  });
}

// 退卡回退
export function backCardFallback(data) {
  return request({
    url: "/customer/account-statement/backCardFallback",
    method: "post",
    data: data,
  });
}

// 显示隐藏流水
export function hideMemberCard(data) {
  return request({
    url: "/customer/card/hide",
    method: "post",
    data: data,
  });
}

// 会员卡列表导出
export function ExcelCustmerCard(data) {
  return request({
    url: "/customer/card/exl",
    method: "post",
    data: data,
    responseType: "blob",
  });
}

// 会员卡余额统计
export function getCardTotal(data) {
  return request({
    url: "/customer/card/total",
    method: "post",
    data: data,
  });
}

// 客户档案-开启关闭扣卡短信验证
export function PayOpen(query) {
  return request({
    url: "/customer/member/payOpen",
    method: "get",
    params: query,
  });
}

// 删除会员
export function deleteMemberData(query) {
  return request({
    url: "/customer/member/delete",
    method: "get",
    params: query,
  });
}

// 会员余额记录查询
export function getBalanceMoney(data) {
  return request({
    url: "/order/total/customer/balance/money",
    method: "post",
    data: data,
  });
}

// 万能验证码
export function getSmsTemp(query) {
  return request({
    url: "/store/sms/sms/temp",
    method: "post",
    params: query,
  });
}

// 万能验证码刷新
export function getSmsTempRefresh(query) {
  return request({
    url: "/store/sms/sms/temp/refresh",
    method: "post",
    params: query,
  });
}
